home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / funatoi.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  721 b   |  33 lines

  1. /*
  2. \funcref{fun\_atoi}{void fun\_atoi ()}
  3.     {}
  4.     {}
  5.     {discard()}
  6.     {fun\_atol(), etc.}
  7.     {funatoi.c}
  8.     {
  9.         This funtion converts the string variable which was last pushed to an
  10.         integer variable. The {\em type} field of the last used stack position
  11.         (this is {\em stack[sp]}) is set to {\em e\_int} and the {\em
  12.         vu.intval} field is assigned to hold the integer representation of the
  13.         {\em vu.str} field.
  14.  
  15.         The string variable which occupied the stack is discarded.
  16.     }
  17. */
  18.  
  19. #include "icm-exec.h"
  20.  
  21. void fun_atoi ()
  22. {
  23.     VAR_
  24.         tmp;
  25.  
  26.     tmp = stack [sp];
  27.  
  28.     stack [sp].type = e_int;
  29.     stack [sp].vu.intval = atoi (tmp.vu.i->ls.str);
  30.  
  31.     discard (tmp);
  32. }
  33.